package com.wumeng.dynamicmultidatabase01.config;

/**
 * @author wumeng 2022/8/11 3:02 下午
 */
public class DBContextHolder {

    private static final ThreadLocal<String> contextHolder = new ThreadLocal<>();

    public static void setCurrentDb(String key) {
        contextHolder.set(key);
    }
    public static String  getCurrentDb() {
        return contextHolder.get();
    }
    public static void clear() {
        contextHolder.remove();
    }
}
